﻿mergeInto(LibraryManager.library, {

Hello: function() {
        window.alert("Hello, world!");
    },
Initiate: function() {
       Start();
    },
LoadFinish: function() {
       LoadFinishRun();
    },
SetCameraMoveFinish: function() {
CameraMoveFinish();
},
  CamerPos: function(str) {
        GetCamerPos(UTF8ToString(str));
    },
  GetMousePos: function(str) {
        GetClickPos(UTF8ToString(str));
    },
  ScreenPoint: function(str) {
        GetScreenPoint(UTF8ToString(str));
    },
  ModelClick: function(str) {
        MouseClick(UTF8ToString(str));
    },
  ModelDoubleClick: function(str) {
        ModelDoubleClick(UTF8ToString(str));
    },
  ModelMouseOver: function(str) {
        MouseOver(UTF8ToString(str));
    },
  ModelMouseOut: function(str) {
        MouseOut(UTF8ToString(str));
    },
  HelloString: function(str) {
        window.alert(UTF8ToString(str));
    },
  Myinfo: function(str) {
       Info(UTF8ToString(str));
    },
  PrintFloatArray: function(array, size) {
        for (var i = 0; i < size; i++)
            console.log(HEAPF32[(array >> 2) + i]);
    },

  AddNumbers: function(x, y) {
        return x + y;
    },

  StringReturnValueFunction: function() {
        var returnStr = "bla";
        var bufferSize = lengthBytesUTF8(returnStr) + 1;
        var buffer = _malloc(bufferSize);
        stringToUTF8(returnStr, buffer, bufferSize);
        return buffer;
    },

  BindWebGLTexture: function(texture) {
        GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[texture]);
    },
   OpenNewPage: function (str) {
            window.open(Pointer_stringify(str));
   },
   OpenPage: function (str) {
          window.location.href = UTF8ToString(str);
   },
  GetCompass: function (str) {
        GetCompassAngles(UTF8ToString(str));
   },
MachineClickJS: function (str) {
        MachineClick(str);
   },
MachineEnterJS: function (str) {
        MachineEnter(str);
   },
MachineEixtJS: function (str) {
        MachineEixt(str);
   },
});